<oc-menu>
	<li>文件(F)
		<ul>
			<li><a ng-click="newTask()">新建(N)</a></li>
			<li><a oc-dialog-open="{name:'openTask/openTask',data:{fn:openTask}}">打开(O)</a></li><hr/>
			<li ng-show="task.taskId"><a ng-click="updateTask()">保存(S)</a></li>
			<li ng-hide="task.taskId"><a oc-file-open="{title:'测试任务 - 保存',actionName:'保存',
				data:taskList,mapUpdatetime:'updatetime',actionFn:createTask}">保存</a></li>
			<li><a oc-file-open="{title:'测试任务 - 另存为',actionName:'另存为',
				data:taskList,mapUpdatetime:'updatetime',actionFn:createTask}">另存为</a></li><hr/>
			<li><a oc-dialog-close>关闭探针(X)</a></li>
		</ul>
	</li>
	<li>编辑(E)
		<ul>
			<li><a ng-click="undo()">撤销</a></li>
			<li><a ng-click="redo()">重复</a></li>
		</ul>
	</li>
	<li>帮助(H)
		<ul>
			<li><a oc-dialog-open="{name:'help/testManagementService'}">测试管理服务</a></li>
			<li><a oc-dialog-open="{name:'help/lemonCase'}">LemonCase语言</a></li><hr/>
			<li><a oc-dialog-open="{name:'help/about'}">关于LemonceProbe</a></li>
		</ul>
	</li>
</oc-menu>
<nav class="oc-toolbar" style="border-bottom:1px solid #aaa;top:1rem">
	<button class="new ico" title="新建"
		ng-click="newTask()"></button>
	<button class="open ico" title="打开"
		 oc-dialog-open="{name:'task/open',data:{fn:openTask}}"></button>
	<button class="save ico" title="保存"
		ng-show="task.taskId"
		ng-click="updateTask()"></button>
	<button class="save ico" title="保存"
		ng-hide="task.taskId"
		ng-click="createTask()"></button><hr/>
	<button class="back ico"></button>
	<button class="next ico"></button>
	<oc-address oc-address-iframe="LCF" style="width:20rem"></oc-address><hr/>

	<button class="play ico" title="构建&启动"
		ng-disabled="!schemas.caseList.length"
		ng-click="casePanel=false;runTask()"></button>
	<button class="stop ico" title="终止"
		ng-click="stopTask()"
		ng-disabled="!ciHEAD"></button>

	<!--<button class="highlight ico" title="指令高亮"></button>-->
</nav>

<div class="grid"
	style="top:2.5rem;bottom:0;right:0;width:20rem;background-color:#f2f2f2;
		border-left:1px solid #aaa;box-sizing:border-box;">
	<nav class="oc-toolbar" style="top:0;width:100%">
		<button class="add ico"
			title="插入用例"
			ng-class="{active:casePanel===true}"
			ng-click="casePanel=!casePanel"></button>
		<button class="delete ico"
			title="取消用例"
			ng-click="deleteCase(caseCtrl.selected)"
			ng-disabled="caseCtrl.selected<0"></button><hr/>
		<button class="down ico"
			ng-click="down(caseCtrl.selected)"
			ng-disabled="caseCtrl.selected<0||caseCtrl.selected>schemas.caseList.length-2"></button>
		<button class="up ico"
			ng-click="up(caseCtrl.selected)" ng-disabled="caseCtrl.selected<1"></button>
		<button class="right trash ico"
			oc-alert-open="{title:'确认清空任务',message:'您确认清空任务里的用例吗？',okFn:trash}"></button><hr/>
	</nav>
	<oc-list style="right:0;left:0;top:1.5rem;bottom:7rem;border-width:1px 0;">
		<oc-inner ng-click="caseCtrl.selected=-1"></oc-inner>
		<oc-row ng-repeat="c in schemas.caseList track by $index"
			ng-click="selectCase($index,$event)"
			ng-dblclick="jumpToCase(c)"
			ng-class="{active:caseCtrl.selected===$index}">
			<oc-col label="#" width="30" locked>{{$index+1}}</oc-col>
			<oc-col label="测试用例名" width="270">{{c.name}}</oc-col>
			<oc-col label="状态" width="60" locked>
				<strong>{{caseStatus[$index]?'通过':'未通过'}}</strong>
			</oc-col>
		</oc-row>
	</oc-list>
	<div id="comment" style="bottom:0">
		<p>
			<span style="font-weight:bold;padding-left:.3rem">名称：</span><input
				ng-model="task.name"
				style="background:transparent;width:22em" />
			<span class="right"
				style="font-weight:bold;color:#000;padding-right:.5rem;">属性</span>
		</p>
		<textarea ng-model="task.comment"></textarea>
	</div>

	<div class="grid" style="top:0;bottom:12rem;left:-14rem;width:14rem;z-index:1;
		background:#f2f2f2;border:solid #aaa;border-width:0 0 1px 1px;margin-left:-1px"
		ng-if="casePanel" ng-controller="AddCase">
		<nav class="oc-toolbar" style="top:0;width:100%">
			<button ng-click="isReviewed=''" class="ico review-all"
				ng-class="{active:isReviewed===''}"></button>
			<button ng-click="isReviewed=true" class="ico review-yes"
				ng-class="{active:isReviewed===true}"></button>
			<button ng-click="isReviewed=false" class="ico review-no"
				ng-class="{active:isReviewed===false}"></button>
			<input type="text" class="search right" ng-model="keyword" />
		</nav>
		<div class="grid"
			style="top:1.5rem;left:0;right:0;height:4rem;overflow:auto;
				border:solid #ccc;border-width:1px 0;background:#fff">
			<span class="tag-selector"
				ng-repeat="(tag, checked) in tagTable"
				ng-class="{'checked': checked}"
				ng-click="tagTable[tag]=!checked">
				{{tag}}&nbsp;
			</span>
		</div>
		<oc-list style="bottom:1.5rem;right:0;left:0;top:5.5rem;border:none;border-bottom:1px solid #ccc">
			<oc-inner ng-click="resetSelect()"></oc-inner>
			<oc-row ng-repeat="c in caseList|filter:{name:keyword,reviewed:isReviewed}|filter:tagsFilterFn"
				ng-click="selectCase(c.caseId,$event)"
				ng-dblclick="selectCase(c.caseId,$event);insertCase()"
				ng-class="{active:caseSelection[c.caseId]}">
				<oc-col label="用例名称" width="215" locked>{{c.name}}</oc-col>
				<oc-col label="审阅" width="40" locked>{{c.reviewed?'是':'否'}}</oc-col>
			</oc-row>
		</oc-list>
		<nav class="oc-toolbar" style="bottom:0;width:100%">
			<button ng-click="insertCase()" class="ico next right"></button>
		</nav>
	</div>
</div>

<div ng-show="mask" class="grid"
	style="left:0;right:0;top:2.5rem;bottom:0;background-color:#000;opacity:.05;z-index:4"></div>
